﻿<?xml version="1.0" encoding="utf-8" ?>

<cls:class
	name="Apic"
	type="http://metalx.org/Apic"
	static="true"
	xmlns="http://metalx.org/Program"
	xmlns:cls="http://metalx.org/Class"
	xmlns:var="http://metalx.org/Variable"
	xmlns:clsf="http://metalx.org/i386/Functions/Class"
	xmlns:date="http://metalx.org/i386/Functions/Date"
	xmlns:time="http://metalx.org/i386/Functions/Time"
	xmlns:clk="http://metalx.org/i386/Functions/Clock"
	xmlns:obj="http://metalx.org/i386/Functions/Object"
	xmlns:sys="http://metalx.org/i386/Functions/System"
	xmlns:cat="http://metalx.org/i386/Functions/Catalog"
	xmlns:str="http://metalx.org/i386/Functions/String"
	xmlns:byte="http://metalx.org/i386/Functions/Byte"
	xmlns:int="http://metalx.org/i386/Functions/Integer"
	xmlns:lst="http://metalx.org/i386/Functions/List"
	xmlns:pcif="http://metalx.org/i386/Functions/Pci"
	xmlns:hex="http://metalx.org/i386/Functions/Hexadecimal"
	xmlns:mm="http://metalx.org/i386/Functions/MemoryManager"
	xmlns:bool="http://metalx.org/i386/Functions/Boolean"
	xmlns:cpu="http://metalx.org/Intel/80386/Operators"
	xmlns:op="http://metalx.org/Intel/80386/Operands"
	xmlns:math="http://metalx.org/Intel/80386/Math"
	xmlns:ari="http://metalx.org/Intel/80386/Arithmetic"
	xmlns:shift="http://metalx.org/Intel/80386/Shift"
	xmlns:imm="http://metalx.org/Intel/80386/Immediate">

	<cls:method name="Start" static="true" type="http://metalx.org/Object">
		<cls:parameter name="Time" type="http://metalx.org/Integer"/>

		<cpu:CopyOperandToRegister/>
		<op:SI-BPAddressPlusImmediate8/>
		<byte>0</byte>

		<obj:GetData/>

		<cpu:CopyOperandToRegister/>
		<op:AX-SIAddress/>

		<cpu:CopyImmediateToSI/>
		<hex>fee00000</hex>

		<cpu:CopyRegisterToOperand/>
		<op:AX-SIAddressPlusImmediate/>
		<hex>00000380</hex>

		<cpu:MathImmediate8ToOperandFunction/>
		<math:AddToBPRegister/>
		<byte>4</byte>

		<cpu:CopyImmediateToDI/>
		<int>0</int>
		
		<cpu:ReturnToNearCaller/>
	</cls:method>

	<cls:method name="GetCurrentCount" static="true" type="http://metalx.org/Integer">
		<cpu:CopyImmediateToSI/>
		<hex>fee00000</hex>

		<cpu:CopyOperandToRegister/>
		<op:AX-SIAddressPlusImmediate/>
		<hex>00000390</hex>

		<label id="createObject"/>

		<int:CreateObject/>

		<cpu:ReturnToNearCaller/>
	</cls:method>
	
	<cls:method name="GetDivideConfiguration" static="true" type="http://metalx.org/Hexadecimal">
		<cpu:CopyImmediateToSI/>
		<hex>fee00000</hex>

		<cpu:CopyOperandToRegister/>
		<op:AX-SIAddressPlusImmediate/>
		<hex>000003e0</hex>

		<label id="createObject"/>

		<hex:CreateObject/>

		<cpu:ReturnToNearCaller/>
	</cls:method>
</cls:class>